<template>
  <view class="product-page">
    <view class="product-top">
      <view class="product-logo">
        <image src="../../static/logo.png" mode=""></image>
      </view>
      <view class="product-search">
        <up-search placeholder="搜索作者或产品名" searchIconColor="#333333" :showAction="false" v-model="keyword"></up-search>
      </view>
    </view>
    <view class="product-list">
      <view class="list-nav" v-for="item,index in 7" :key="index" @click="maskShow = index">
        <view class="nav-img">
          <view class="nav-mask" :style="maskShow == index ? 'border: 2rpx solid #FF416C':'border:none'"></view>
          <image src="../../static/logo.png" mode=""></image>
        </view>
        <view class="nav-text">测试</view>
      </view>
    </view>
    <view class="product-assort">
      <view :class="assortType?'assort-release':'assort-view'" @click="assortType = true">最新发布</view>
      <view :class="assortType?'assort-view':'assort-release'" @click="assortType = false">观看人数</view>
    </view>
  </view>
  <view class="product-submit-bar">
    <view class="submit-collect">
      <up-icon name="heart-fill" color="#F7BA1E" size="48rpx" v-if="heartShow" @click="heartShow = false"></up-icon>
      <up-icon name="heart" size="48rpx" v-else @click="heartShow = true"></up-icon>
      <view class="submit-text">{{heartShow? '取消收藏':'收藏'}}</view>
    </view>
    <view class="submit-share">
      <up-icon name="share-square" size="48rpx"></up-icon>
      <view class="submit-text">分享</view>
    </view>
    <view class="submit-btn">
      <view class="btn-customized">立即定制</view>
      <view class="btn-payment">购买同款</view>
    </view>
  </view>
</template>

<script setup>
  import {
    ref
  } from 'vue'
  const keyword = ref('')
  const assortType = ref(true)
  const maskShow = ref(0)
  const heartShow = ref(false)
</script>

<style lang="less" scoped>
  .product-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;

    .product-top {
      height: 88rpx;
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;

      .product-logo {
        width: 200rpx;
        position: absolute;
        left: 32rpx;

        image {
          width: 140rpx;
          height: 50rpx;

        }
      }

      .product-search {
        width: 340rpx;
        height: 72rpx;
        display: flex;
        align-items: center;
      }
    }

    .product-list {
      height: 194rpx;
      width: 100%;
      display: flex;
      align-items: center;
      box-sizing: border-box;
      padding: 0 32rpx;
      overflow: scroll;

      .list-nav {
        width: 128rpx;
        height: 100%;
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        margin: 16rpx;

        .nav-img {
          width: 132rpx;
          height: 104rpx;
          border-radius: 34rpx;
          position: relative;
          display: flex;
          align-items: flex-end;
          justify-content: center;
          overflow: hidden;
          box-sizing: border-box;
          padding: 2rpx;

          .nav-mask {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 128rpx;
            height: 64rpx;
            border-radius: 220rpx;
            background: #F2F2F2;
            z-index: 0;
            overflow: hidden;
          }

          image {
            width: 104rpx;
            height: 88rpx;
            z-index: 1;
          }
        }

        .nav-text {
          margin-top: 14rpx;
          font-size: 28rpx;
          color: rgba(51, 51, 51, 1);

        }
      }
    }

    .product-assort {
      width: 750rpx;
      height: 88rpx;
      box-sizing: border-box;
      padding: 12rpx 32rpx;
      display: flex;
      align-items: center;

      .assort-release {
        width: 160rpx;
        height: 64rpx;
        border-radius: 398rpx;
        background: #FFE8EA;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 28rpx;
        color: rgba(255, 65, 108, 1);
        margin-right: 16rpx;
      }

      .assort-view {
        width: 160rpx;
        height: 64rpx;
        border-radius: 398rpx;
        background: #F2F2F2;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 28rpx;
        color: #333333;
        margin-right: 16rpx;
      }
    }
  }

  .product-submit-bar {
    width: 100%;
    height: 100rpx;
    background: rgba(255, 255, 255, 1);
    position: fixed;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 20rpx;
    color: rgba(51, 51, 51, 1);
    box-sizing: border-box;
    padding: 0 32rpx;
    justify-content: space-between;

    .submit-collect {
      width: 80rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .submit-share {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .submit-btn {
      font-size: 28rpx;
      color: rgba(255, 255, 255, 1);
      display: flex;
      border-radius: 114rpx;
      overflow: hidden;

      .btn-customized {
        width: 254rpx;
        height: 80rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(51, 51, 51, 1);
      }

      .btn-payment {
        width: 254rpx;
        height: 80rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 65, 108, 1);
      }
    }

    .submit-text {
      margin-top: 4rpx;
    }
  }
</style>